Some personal computers (PC) employ a hard disk device as a secondary storage device. In such PCs, a technology is known for backing up data that has been stored in the hard disk device to prevent the data from becoming invalid because of some failure. For example, when act of changing data in the hard disk device is detected, a snapshot as a backup copy of the data before the change is taken and a log of changes made to the data is generated. Then, processing for taking a new snapshot, invalidating a log taken in the past before the new snapshot was taken, and generating a new log is repeated at every predetermined time (see, for example, US Patent Application Publication No. 2006/0224636). In case data becomes invalid due to some reason, the data can be restored by referring to the snapshot and the log. There are typically two types of logs: pre-update log and post-update log. The pre-update log is a log that is generated, before update of data, as an update plan indicating how the data is going to be updated. On the other hand, the post-update log is a log for approving, after the data is actually updated, updating of the data.
In recent years, a capacity of a NAND flash memory as a nonvolatile semiconductor storage device has been increased dramatically. As a result, PCs including a memory system having the NAND flash memory as a secondary storage device have been put to practical use. However, the technology disclosed in US Patent Application Publication No. 2006/0224636 cannot be applied to backup of data stored in such a personal computer having the NAND flash memory as the secondary storage device as in the case of backup of data stored in the personal computer having the hard disk device as the secondary storage device. This is because a multi-value memory technology that can store a plurality of data (multi-value data) equal to or larger than 2 bits in one memory cell is employed to increase the capacity of the NAND flash memory.
A memory cell configuring a multi-value memory has a field effect transistor structure having a stacked gate structure in which a gate insulating film, a floating gate electrode, an inter-gate insulating film, and a control gate electrode are stacked in order on a channel region and a plurality of threshold voltages can be set according to the number of electrons accumulated in the floating gate electrode. In order to make it possible to perform multi-value storage based on the plurality of threshold voltages, the distribution of a threshold voltage corresponding to one data needs to be made extremely narrow.
For example, as a multi-value memory that can store four values, there is a multi-value memory that includes a lower order page and a higher order page in one memory cell and stores 2 bits (four values) by writing 1-bit data in the respective pages. In a method of writing data in such a multi-value memory, after data is written in a lower order page of a first memory cell, data is written in a lower order page of a memory cell (a second memory cell) that is adjacent to the first memory cell. After data is written in this adjacent memory cell, data is written in a higher order page of the first memory cell (see, for example, JP-A 2004-192789 (KOKAI)).
However, in such a multi-value memory, a threshold voltage of the first memory cell in which data has been written earlier fluctuates because of a threshold voltage of the second memory cell in which the data is written later and that is adjacent to the first memory cell. Therefore, in the multi-value memory, it is likely that lower order page breakage occurs in which, if writing is suspended because of, for example, abnormal isolation of a power supply while data is being written in a higher order page of a certain memory cell, data in a lower order page in which the data is written earlier is also broken.
Therefore, when the conventional technology in which a log is stored and then a backup is taken is applied to the memory system employing the NAND flash memory, there is a problem in that, if abnormal isolation of a power supply occurs during writing of the log, the log that is currently being written and even logs that have been already stored are broken.
When a program error occurs while writing of data is performed, rewriting of the data is performed. However, conventionally, a method of generating a log in such a case, in particular, a method of generating a log including processing during reset when abnormal isolation of the power supply further occurs during writing of the log has not been taken into account.